package com.dream.utils.email;

import java.util.ArrayList;
import java.util.List;
/**
 * @copyright evan
 * @author evan
 * @Revision
 * @date 2012/09/01
 */
public class EMailBean {
	
		@Override
		public int hashCode() {
			return super.hashCode();
		}
		
		@Override
		public boolean equals(Object obj) {
			return super.equals(obj);
		}

		private List<MailType> mailTypes ;
		private String signature;
		private String toEmail;
		private String fromPassword;
		private String fromEmail;
		private String subject;
		private String content;
		
		public String getSubject() {
			return subject;
		}
		public void setSubject(String subject) {
			this.subject = subject;
		}
		public String getContent() {
			return content + signature;
		}
		public void setContent(String content) {
			this.content = content;
		}
		public EMailBean copy(){
			EMailBean mail = new EMailBean();
			mail.signature = signature;
			mail.toEmail = toEmail;
			mail.fromEmail = fromEmail;
			mail.fromPassword = fromPassword;
			List<MailType> ts = new ArrayList<MailType>();
			mail.mailTypes = ts;
			for(MailType t : mailTypes){
				MailType tm = new MailType();
				tm.setSubject(t.subject);
				tm.setContent(t.content);
				ts.add(tm);
			}
			return mail;
		}
		public String getToEmail() {
			return toEmail;
		}
		public void setToEmail(String toEmail) {
			this.toEmail = toEmail;
		}
		public String getFromPassword() {
			return fromPassword;
		}
		public void setFromPassword(String fromPassword) {
			this.fromPassword = fromPassword;
		}
		public String getFromEmail() {
			return fromEmail;
		}
		public void setFromEmail(String fromEmail) {
			this.fromEmail = fromEmail;
		}
		public List<MailType> getMailTypes() {
			return mailTypes;
		}
		public void setMailTypes(List<MailType> mailTypes) {
			this.mailTypes = mailTypes;
		}
		public String getSignature() {
			return signature;
		}
		public void setSignature(String signature) {
			this.signature = signature;
		}
		
		public static class MailType implements java.io.Serializable {
			private static final long serialVersionUID = 1L;
			private String subject;
			private String content;
			public String getSubject() {
				return subject;
			}
			public void setSubject(String subject) {
				this.subject = subject;
			}
			public String getContent() {
				return content;
			}
			public void setContent(String content) {
				this.content = content;
			}

		}
}
